function lbhs(ol,ul,l,r,box,w) {
    var ol =ol
    var ul =ul
    var l =l
    var w=w;
    var circle=0
    var flag=true
    var timer
    var box =box
    var r =r
    for(let a=0;a<ul.children.length;a++){
        var li =document.createElement('li')
        li.setAttribute('index',a)
        ol.appendChild(li)
        ol.children[a].addEventListener('click',function(){
            for (let a = 0; a < ol.children.length; a++) {
                ol.children[a].className=''
            }
            this.className='current'
            var index = this.getAttribute('index')
            circle=index
            num=index
            animate(ul,-index*w,function(){
                flag=true
            })
        })
    }
    var num =0
    ol.children[0].className='current'
    var copy=ul.children[0].cloneNode(true)
    ul.appendChild(copy)
    r.addEventListener('click',function(){
        
        if(flag){
            flag=false
        
        if(num == ul.children.length-1){
            num =0 
            ul.style.left=0
        }
        num++
        animate(ul,-num*w,function(){
            flag=true
        })
        circle++
        if(circle ==ul.children.length-1){
            circle=0
        }
        for(var i =0;i<ol.children.length;i++){
            ol.children[i].className=''
        }
        ol.children[circle].className='current'
    }
    })
    l.addEventListener('click',function(){
        if(flag){
            flag=false
        if(num ==0){
            num=ul.children.length-1
            ul.style.left=-num*w+'px'
        }
        num--
        animate(ul,-num*w,function(){
            flag=true
        })
       circle--
       if(circle<0){
           circle=ol.children.length-1
       }
       for(var i =0 ;i<ol.children.length;i++){
           ol.children[i].className=''
       }
       ol.children[circle].className='current'
    }
    })
    timer=setInterval(function(){
            r.click()
        },3000)
    box.addEventListener('mouseenter',function(){
        clearInterval(timer)
    })
    box.addEventListener('mouseleave',function(){
        timer=setInterval(function(){
            r.click()
        },3000)
    })
    }